<!DOCTYPE html>
<html lang="en">
<head>
    <title id="Description">Using jqxGrid with JSP and MySQL..</title>
    <link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.css" />
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var source = {
                datatype: "json",
                datafields: [{
                    name: 'FirstName',
                    type: 'string'
                }, {
                    name: 'LastName',
                    type: 'string'
                }, {
                    name: 'Title',
                    type: 'string'
                }, {
                    name: 'BirthDate',
                    type: 'date'
                }],
                id: 'EmployeeID',
                url: 'jsp/select-data.jsp',
                async: true
            };
            var dataAdapter = new $.jqx.dataAdapter(source);

            $("#jqxgrid").jqxGrid({
                width: 550,
                autoheight: true,
                source: dataAdapter,
                columns: [{
                    text: 'First Name',
                    datafield: 'FirstName',
                    width: 100
                }, {
                    text: 'Last Name',
                    datafield: 'LastName',
                    width: 100
                }, {
                    text: 'Title',
                    datafield: 'Title',
                    width: 180
                }, {
                    text: 'Birth Date',
                    datafield: 'BirthDate',
                    cellsformat: 'd',
                    align: 'right',
                    cellsalign: 'right'
                }]
            });
        });
    </script>
</head>
<body>
    <div id="jqxgrid"></div>
</body>
</html>
